﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="T4Airline.Website._Default" %>

<%@ Register Assembly="DevExpress.XtraCharts.v14.1.Web, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts.Web" TagPrefix="dxchartsui" %>


<%@ Register Assembly="DevExpress.Web.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>

<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxClasses" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridLookup" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>

<%@ Register assembly="DevExpress.XtraCharts.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraCharts" tagprefix="cc1" %>

<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxCallbackPanel" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
	<script src="Scripts/jquery.simpleWeather.js"></script>
	<link href="Content/simpleweather.css" rel="stylesheet" />
	<style type="text/css">
body { background-color: transparent; }
</style>
	<asp:SqlDataSource ID="sqlAirports" runat="server" ConnectionString="<%$ ConnectionStrings:team4AirlineConnectionString %>" SelectCommand="SELECT [AirportName], [AirportCode], [City], [ID], [State], [County] FROM [Airports]"></asp:SqlDataSource>

				
					<dx:ASPxPageControl ID="ASPxPageControl1" ClientInstanceName="pcMain" runat="server"  Width="75%" Height="600px" ActiveTabIndex="0">
							<TabPages>
								<dx:TabPage Text="Flight Info">
									<ContentCollection>
										<dx:ContentControl runat="server">
											<table class="paddedTable">
												<tr>
													<td>From</td>
													<td>To</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
												</tr>
												<tr>
													<td>
														<dx:ASPxGridLookup ID="grdFrom" runat="server" AutoGenerateColumns="False" DataSourceID="sqlAirports" EnableTheming="True" Height="50px" IncrementalFilteringMode="Contains" KeyFieldName="ID" NullText="Enter Departure" TextFormatString="{2}, {4} ({1})" Width="280px" ClientInstanceName="grdFrom">
															<GridViewProperties>
																<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" />
															</GridViewProperties>
															<Columns>
																<dx:GridViewDataTextColumn FieldName="AirportName" ShowInCustomizationForm="True" VisibleIndex="3">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="AirportCode" ShowInCustomizationForm="True" VisibleIndex="2">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="City" ShowInCustomizationForm="True" VisibleIndex="0">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="ID" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="4">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="State" ShowInCustomizationForm="True" VisibleIndex="1">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="County" ShowInCustomizationForm="True" Visible="False" VisibleIndex="5">
																</dx:GridViewDataTextColumn>
															</Columns>
															<ClientSideEvents ValueChanged="getDepartureAirportCode" />
														</dx:ASPxGridLookup>
													</td>
													<td>
																				<dx:ASPxGridLookup ID="grdTo" runat="server" AutoGenerateColumns="False" ClientInstanceName="grdTo" DataSourceID="sqlAirports" Height="50px" IncrementalFilteringMode="Contains" KeyFieldName="ID" NullText="Enter Destination" TextFormatString="{2}, {4} ({1})" Width="280px">
																					<GridViewProperties>
																						<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" />
																					</GridViewProperties>
																					<Columns>
																						<dx:GridViewDataTextColumn FieldName="AirportName" ShowInCustomizationForm="True" VisibleIndex="3">
																						</dx:GridViewDataTextColumn>
																						<dx:GridViewDataTextColumn FieldName="AirportCode" ShowInCustomizationForm="True" VisibleIndex="2">
																						</dx:GridViewDataTextColumn>
																						<dx:GridViewDataTextColumn FieldName="City" ShowInCustomizationForm="True" VisibleIndex="0">
																						</dx:GridViewDataTextColumn>
																						<dx:GridViewDataTextColumn FieldName="ID" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="4">
																						</dx:GridViewDataTextColumn>
																						<dx:GridViewDataTextColumn FieldName="State" ShowInCustomizationForm="True" VisibleIndex="1">
																						</dx:GridViewDataTextColumn>
																						<dx:GridViewDataTextColumn FieldName="County" ShowInCustomizationForm="True" Visible="False" VisibleIndex="5">
																						</dx:GridViewDataTextColumn>
																					</Columns>
																					<ClientSideEvents ValueChanged="getDestinationAirportCode" />
																				</dx:ASPxGridLookup>
													</td>
													<td>
								
																	&nbsp;</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
												</tr>
												<tr>
													<td>
														<div id="weatherDepart"></div>
													

						
													</td>
													<td>				
														<div id="weatherArrive">
														</div>
													</td>
													<td>
														&nbsp;</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
												</tr>
												<tr>
													<td>		

														Departure Date</td>
													<td>
													
										
														&nbsp;</td>
													<td></td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
												</tr>
												<tr>
													<td>
														<dx:ASPxDateEdit ID="deDate" runat="server" ClientInstanceName="deDate" Height="50px" NullText="Select Departure Date" Width="300px">
															<ClientSideEvents DateChanged="processDateChange" />
														</dx:ASPxDateEdit>
													</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
												</tr>
											</table>

										</dx:ContentControl>
									</ContentCollection>
								</dx:TabPage>
								<dx:TabPage Text="Matching Routes">
									<ContentCollection>
										<dx:ContentControl runat="server">
											<dx:ASPxGridView ID="grdRoutes" ClientInstanceName="grdRoutes" runat="server" AutoGenerateColumns="False" >
												<Columns>
													<dx:GridViewDataTextColumn Caption="Origin Airport" FieldName="DepartureAirport.AirportCode" ShowInCustomizationForm="True" VisibleIndex="2">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn Caption="Origin City" FieldName="DepartureAirport.City" ShowInCustomizationForm="True" VisibleIndex="3">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="ID" ShowInCustomizationForm="True" Visible="False" VisibleIndex="4">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn Caption="Origin State" FieldName="DepartureAirport.State" ShowInCustomizationForm="True" VisibleIndex="5" Visible="False">
													</dx:GridViewDataTextColumn>
												
													<dx:GridViewDataTextColumn FieldName="AirlineSelected.AirlineName" ShowInCustomizationForm="True" VisibleIndex="1" Caption="Airline Name">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="AirlineSelected.AirlineCode" ShowInCustomizationForm="True" VisibleIndex="7" Visible="False">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="ArrivalAirport.AirportCode" ShowInCustomizationForm="True" VisibleIndex="9" Caption="Arrival Airport">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="ArrivalAirport.City" ShowInCustomizationForm="True" VisibleIndex="10" Caption="Arrival City">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="ArrivalAirport.State" ShowInCustomizationForm="True" VisibleIndex="12" Visible="False">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="EstimatedMinutesDepartureDelayed" Caption="&gt;15min Depart Chance" ShowInCustomizationForm="True" VisibleIndex="13">
																	<PropertiesTextEdit DisplayFormatString="p0"></PropertiesTextEdit>
													</dx:GridViewDataTextColumn>
														<dx:GridViewDataTextColumn FieldName="EstimatedMinutesArrivalDelayed" Caption="&gt;15min Arrival Chance" ShowInCustomizationForm="True" VisibleIndex="14">
															<PropertiesTextEdit DisplayFormatString="p0"></PropertiesTextEdit>
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn Caption="Via" FieldName="ConnectingAirport.AirportCode" ShowInCustomizationForm="True" VisibleIndex="11">
													</dx:GridViewDataTextColumn>
												</Columns>
												<SettingsPager Visible="False">
												</SettingsPager>
											</dx:ASPxGridView>
					
										</dx:ContentControl>
									</ContentCollection>
								</dx:TabPage>
								<dx:TabPage Text="Statistics">
									<ContentCollection>
										<dx:ContentControl runat="server">

											<dx:ASPxCallbackPanel ID="cbpChart" ClientInstanceName="cbpChart" runat="server" Width="200px">
						<PanelCollection>
<dx:PanelContent runat="server">
	<dxchartsui:WebChartControl ID="WebChartControl1" runat="server" CrosshairEnabled="True" Height="400px" PaletteName="Concourse" Width="600px">
						<diagramserializable>
							<cc1:XYDiagram>
								<axisx visibleinpanesserializable="-1">
								</axisx>
								<axisy visibleinpanesserializable="-1">
									<label textpattern="{V:0%}">
									</label>
								</axisy>
							</cc1:XYDiagram>
						</diagramserializable>
						<seriesserializable>
							<cc1:Series ArgumentScaleType="Qualitative" Name="DepartureDelay" CrosshairLabelPattern="Departure Delay Chance  :  {V:P0}">
								<labelserializable>
									<cc1:SideBySideBarSeriesLabel TextPattern="{S} : {V:0.00%}">
									</cc1:SideBySideBarSeriesLabel>
								</labelserializable>
							</cc1:Series>
							<cc1:Series ArgumentScaleType="Qualitative" Name="ArrivalDelay" CrosshairLabelPattern="Arrival Delay Chance  :  {V:P0}">
								<labelserializable>
									<cc1:SideBySideBarSeriesLabel TextPattern="{S} : {V:0%}">
									</cc1:SideBySideBarSeriesLabel>
								</labelserializable>
							</cc1:Series>
						</seriesserializable>
	</dxchartsui:WebChartControl>

</dx:PanelContent>
</PanelCollection>
	</dx:ASPxCallbackPanel>
								
										</dx:ContentControl>
									</ContentCollection>
								</dx:TabPage>
							</TabPages>
					<ClientSideEvents ActiveTabChanged ="mainTabChanged" />
							<paddings paddingtop="100px" />
						</dx:ASPxPageControl>

</asp:Content>
